import request from '@/utils/request'

// 查询企业的部门列表
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}

// 新增部门
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data: data
  })
}

// 删除部门信息
export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

// 更新部门信息
export function updateDepartment(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
